import axios from 'axios'

// 分页查询客户数据
export const queryCustomer = (moduleId, params, pageNum, pageSize) => {
  return axios.post(`/api/customers/query/${moduleId}`, params, {
    params: {
      pageNum,
      pageSize
    }
  })
}

// 根据ID获取客户
export const getCustomer = (id) => {
  return axios.get(`/api/customers/${id}`)
}

// 保存或更新客户
export const saveCustomer = (customer) => {
  return axios.post('/api/customers', customer)
}

// 删除客户
export const deleteCustomer = (id) => {
  return axios.delete(`/api/customers/${id}`)
}
